/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.jr2tecnologia.controller.dashboard;

import br.com.jr2tecnologia.LoggerFactory;
import br.com.jr2tecnologia.model.ConfigPersistenceLocal;
import br.com.jr2tecnologia.model.ModemPersistenceLocal;
import br.com.jr2tecnologia.model.entity.Config;
import br.com.jr2tecnologia.model.entity.Modem;
import java.io.Serializable;
import java.util.List;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author ronildo
 */

@ManagedBean
@SessionScoped
public class ConfigDashboardMBean implements Serializable{

    private static final Logger logger = LoggerFactory.getLogger();

    @EJB
    private ModemPersistenceLocal modemPersistence;
    @EJB
    private ConfigPersistenceLocal configPersistence;

    private List<Modem> listModem;
    private List<Config> listConfig;

    @PostConstruct
    public void initialize(){
        searchModem();
        searchConfig();
    }

    public void searchModem(){
        listModem = modemPersistence.listAll();
    }

    public void searchConfig(){
        listConfig = configPersistence.listAll();
    }

    public List<Modem> getListModem() {
        return listModem;
    }

    public void setListModem(List<Modem> listModem) {
        this.listModem = listModem;
    }

    public List<Config> getListConfig() {
        return listConfig;
    }

    public void setListConfig(List<Config> listConfig) {
        this.listConfig = listConfig;
    }
}
